<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        #box{
            width: 100px;
            height: 100px;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <h1>JS 获取页面中的一个元素</h1>
    <hr>

    <div id="box">1111</div>

    <script>
        var div = document.getElementById('box');
        // console.dir(div);
        
        div.style.backgroundColor = '#f90';
        div.style.color = '#fff';
        div.innerHTML = 'hi, linlin';
        console.log(div.innerHTML);

    </script>
</body>
</html>